package com.ashapo.pattern.pattern031servicelocator;

//第6步
//使用ServiceLocator类来演示服务定位器设计模式。

public class ServiceLocatorPatternDemo {

    /**
     * 服务定位器设计模式
     * @param args
     */
    public static void main(String[] args) {
        Service service = ServiceLocator.getService("Service1");
        service.execute();
        service = ServiceLocator.getService("Service2");
        service.execute();
        service = ServiceLocator.getService("Service1");
        service.execute();
        service = ServiceLocator.getService("Service2");
        service.execute();
    }

}
